<?php

function lib_brandlist(&$ctag,&$refObj){
	 global $dsql;
	 //属性处理
 	$attlist="row|100";
    FillAttsDefault($ctag->CAttribute->Items,$attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    
    $innertext = $ctag->GetInnerText();
    $row = !empty($row) ? $row : 100;
    
    $query = "SELECT id,typename,picname FROM `#@__arctype` WHERE reid=52 limit ".$row;
    $dsql->Execute('me', $query);
    
    
    $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
    $tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
    $html = '<li><a href="/list-'.$tid.'.html"'.(($bid == 0) ? " class='on' " : '').'>所有品牌</a></li>';
    
    while ($row = $dsql->GetArray('me')){
    	$html .= '<li><a href="/list-'.$tid.'.html?bid='.$row['id'].'" '.(($bid == $row['id']) ? " class='on' " : '').'>'.$row['typename'].'</a></li>';
    }
    return $html;
}
?>